From: Florian Müllner Date: Sat, 20 Feb 2010 03:28:47 +0000 (+0100) Subject: [messageTray] Fix text with ampersands not being displayed X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~10426 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=79fe60e6fb2d3aa1a5389f50b1840503cd3b723d;p=gnome-shell.git [messageTray] Fix text with ampersands not being displayed If the notification body contains '&' it ends up empty and a warning about an invalid entity is printed on stderr, so our escape code must handle ampersands as well. https://bugzilla.gnome.org/show_bug.cgi?id=607375 --- diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 039685a1c..06dd250bb 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -27,9 +27,12 @@ const State = { }; function _cleanMarkup(text) { + // Support &, ", ', < and >, escape all other + // occurrences of '&'. + let _text = text.replace(/&(?!amp;|quot;|apos;|lt;|gt;)/g, "&"); // Support , , and , escape anything else // so it displays as raw markup. - return text.replace(/<(\/?[^biu]>|[^>\/][^>])/g, "<$1"); + return _text.replace(/<(\/?[^biu]>|[^>\/][^>])/g, "<$1"); } // Notification: @@ -295,7 +298,6 @@ Notification.prototype = { popIn: function() { if (this.actor.row_count <= 1) return false; - Tweener.addTween(this._bannerLabel, { opacity: 255, time: ANIMATION_TIME,